package net.xxcxcxcx.xc_enhancedmob.register;

import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder;
import net.minecraft.entity.EntityDimensions;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import net.xxcxcxcx.xc_enhancedmob.entity.SaveFireballEntity;
import net.xxcxcxcx.xc_enhancedmob.entity.SaveFireworkRocketEntity;

import static net.xxcxcxcx.xc_enhancedmob.EnhancedMobMod.ModId;

public class EntityRegister {
    public static EntityType<SaveFireballEntity> SaveFireballEntityType;
    public static EntityType<SaveFireworkRocketEntity> SaveFireworkRocketType;

    public static void Register() {
        SaveFireballEntityType = Registry.register(
                Registry.ENTITY_TYPE,
                new Identifier(ModId, "save_fireball"),
                FabricEntityTypeBuilder.<SaveFireballEntity>create(SpawnGroup.MISC, SaveFireballEntity::new)
                        .dimensions(EntityDimensions.fixed(0.25F, 0.25F)) // dimensions in Minecraft units of the projectile
                        .trackRangeBlocks(4).trackedUpdateRate(10) // necessary for all thrown projectiles (as it prevents it from breaking, lol)
                        .fireImmune()
                        .build() // VERY IMPORTANT DONT DELETE FOR THE LOVE OF GOD PSLSSSSSS
        );
        SaveFireworkRocketType = Registry.register(
                Registry.ENTITY_TYPE,
                new Identifier(ModId, "save_fireworkrocket"),
                FabricEntityTypeBuilder.<SaveFireworkRocketEntity>create(SpawnGroup.MISC, SaveFireworkRocketEntity::new)
                        .dimensions(EntityDimensions.fixed(0.25F, 0.25F)) // dimensions in Minecraft units of the projectile
                        .trackRangeBlocks(4).trackedUpdateRate(10) // necessary for all thrown projectiles (as it prevents it from breaking, lol)
                        .build() // VERY IMPORTANT DONT DELETE FOR THE LOVE OF GOD PSLSSSSSS
        );
    }
}
